package com.conditional.domain;

public class Employee {


    public static final int ENGINEER = 0;

    public static final int SALEMAN = 1;
    public static final int MANAGER = 2;


    private EmployeeType type;

    public int getType() {
        return type.getTypeCode();
    }

    private double monthlySalary;

    private double commission;
    private double bonus;


    double payAmount() {
        switch (getType()) {
            case EmployeeType.ENGINEER:
                return monthlySalary;
            case EmployeeType.SALESMAN:
                return monthlySalary + commission;
            case EmployeeType.MANAGER:
                return monthlySalary + bonus;
            default:
                throw new RuntimeException("Incorrect Employee");
        }

    }


}
